package log

import (
	"os"

	"gitee.com/ameise84/e3log"
	"gitee.com/ameise84/e3net"
	"gitee.com/ameise84/e3time"
)

var _gLogger *e3log.Logger

func init() {
	w := e3log.NewConsoleWriter(os.Stdout)
	l := e3log.NewLogger(w)
	l.SetLevel(e3log.LevelTrace)
	SetLogger(l)
}

func GetLogger() *e3log.Logger {
	return _gLogger
}

func SetLogger(l *e3log.Logger) {
	_gLogger = l
	e3net.SetLogger(_gLogger)
	e3time.SetLogger(_gLogger)
}
